Repository navigation
pkey: fix compilation with OpenSSL 4.1 - #183
Merged
Merged
Conversation
moritzbuhl
force-pushed
the
mbuhl-182
branch
from
September 2, 2026 05:36
4dd130b to
ed0b0bf
Compare
| #include "tpm2-provider-pkey.h" | ||
|
|
||
| #if OPENSSL_VERSION_NUMBER >= 0x40100000 | ||
| #define TPM2_ASN1_STRING_length(x) ASN1_STRING_get_length(x) |
Member
There was a problem hiding this comment.
I'd recommend to use macro names aligned with the new api; i.e. "TPM2_ASN1_STRING_set_length" and "TPM2_ASN1_STRING_set1_data"
Also, do we have a CI job running OpenSSL 4.1 for testing this ?
Member
Author
There was a problem hiding this comment.
We are testing against the following branches: openssl-3.0, openssl-3.5, master
master will become 4.1 and to my understanding it should be a LTS release that is worth adding to our CI.
I'll rename the macros.
Avoid deprecated OpenSSL functions, add fallback defines for older versions: src/tpm2-provider-pkey.c:91:5: error: 'ASN1_STRING_set' is deprecated: Since OpenSSL 4.1; use ASN1_STRING_set1_data() or ASN1_STRING_set1_string() [-Werror,-Wdeprecated-declarations] src/tpm2-provider-pkey.c:165:41: error: 'ASN1_STRING_length' is deprecated: Since OpenSSL 4.1; use ASN1_STRING_get_length() [-Werror,-Wdeprecated-declarations] Add missing header: src/tpm2-provider-pkey.c:32:1: error: call to undeclared function 'ERR_raise'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] Signed-off-by: Moritz Buhl <moritz.buhl@infineon.com>
moritzbuhl
force-pushed
the
mbuhl-182
branch
from
September 9, 2026 13:34
ed0b0bf to
a37336b
Compare
AndreasFuchsTPM
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid deprecated OpenSSL functions, add fallback defines for older versions:
src/tpm2-provider-pkey.c:91:5: error: 'ASN1_STRING_set' is deprecated: Since OpenSSL 4.1; use ASN1_STRING_set1_data() or ASN1_STRING_set1_string() [-Werror,-Wdeprecated-declarations]
src/tpm2-provider-pkey.c:165:41: error: 'ASN1_STRING_length' is deprecated: Since OpenSSL 4.1; use ASN1_STRING_get_length()
[-Werror,-Wdeprecated-declarations]
Add missing header:
src/tpm2-provider-pkey.c:32:1: error: call to undeclared function 'ERR_raise'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
Addresses #182